package com.itheima.controller;

import com.itheima.pojo.ClazzOption;
import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        JobOption jobOption = reportService.getEmpData();
        return Result.success(jobOption);
    }

    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map> mapList = reportService.getEmpGenderData();
        return Result.success(mapList);
    }

    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        ClazzOption ClazzOption = reportService.getStudentCountData();
        return Result.success(ClazzOption);
    }

    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<Map> mapList = reportService.getStudentDegreeData();
        return Result.success(mapList);
    }
}
